<?php

namespace app\validate;

use think\Validate;

class Business extends Validate
{
    /**
     * 证书管理&业务管理验证器
     */

    protected $rule = [
        'business_name'=>['require'],//业务名称
        'business_type' =>['require'],//业务类别
        'head_id'=>['require'],//负责人id
    ];

    protected $message = [
        'business_name.require'=>'业务名称不能为空',
        'business_type.require'=>'业务类别不能为空',
        'head_id.require'=>'负责人id不能为空',
        'is_k.require'=>'必须选择开关操作'
    ];

    public function sceneEdit()
    {
        return $this->only(['id','business_name','business_type'])
            ->append('id','require')
            ->append('certificate_name','require')
            ->append('business_type','require');
    }

    public function sceneIsDe()
    {
        return $this->only(['id','is_k'])
            ->append('id','require')
            ->append('is_k','require');
    }


}